package com.test.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.test.intercept.SqlIntercept;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanConfigutarion {

    @Bean
    public MybatisPlusInterceptor sqlIntercept(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        //拦截器：动态拼接sql
        mybatisPlusInterceptor.addInnerInterceptor(new SqlIntercept());
        return mybatisPlusInterceptor;
    }
}
